class Student(object):
    # __slots__ = ('name', 'age')

    @property
    def score(self):
        return self._score

    @score.setter
    def score(self, value):
        if not isinstance(value, int):
            raise ValueError('score must be an integer!')
        if value < 0 or value > 100:
            raise ValueError('score must between 0~100!')
        self._score = value

        # def set_score(self, score):
        #     self.score = score


class Person(object):
    @property
    def birth(self):
        return self._birth

    @birth.setter
    def birth(self, value):
        self._birth = value

    @property
    def age(self):
        return 2015 - self._birth


#
# s1 = Student()
# s1.name = 'zhang3'
s2 = Student()
s2.score = 60

print(s2.score)

p1=Person()
# p1.age=12
p1.birth=1980
print(p1.birth)
print(p1.age)
